package com.matrix.draft.helloworld.sys;

import com.github.kwhat.jnativehook.mouse.NativeMouseEvent;
import com.github.kwhat.jnativehook.mouse.NativeMouseListener;

import java.awt.event.MouseEvent;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicBoolean;

public class MyNativeMouseRightPressListener implements NativeMouseListener {

    private SmartRobot smartRobot;

    private MyNativeMouseRightPressListener() {
    }

    public MyNativeMouseRightPressListener(SmartRobot smartRobot) {
        this.smartRobot = smartRobot;
    }

    @Override
    public void nativeMousePressed(NativeMouseEvent nativeEvent) {
        NativeMouseListener.super.nativeMousePressed(nativeEvent);
        if (MouseEvent.BUTTON2 == nativeEvent.getButton()) {
            DoMovingThread doMovingThread = TestMouseMoving.doMovingThread;
            if(!doMovingThread.isAlive()){
                doMovingThread.resumeThread();
            }

        }
    }
}
